#!/bin/bash

update() {
    if which pkg &> /dev/null; then
        pkg update && pkg upgrade
    elif which apt &> /dev/null; then
        sudo apt update && sudo apt upgrade
    elif which pacman &> /dev/null; then
        sudo pacman -Syu
    else
        echo "I only know pkg/apt/pacman"
    fi
}

take() {
    if [ -n "$1" ]; then
        mkdir -p "$1"
        cd "$1" || return
    fi
}

gdiff() {
    if [ -n "$1" ] && [ -n "$2" ]; then
        git diff --no-index --word-diff "$1" "$2"
    else
        echo "Usage: gdiff <old_file> <new_file>"
    fi
}
